﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.Odbc;
using System.Data.SqlClient;
using Projeto.TCC.Dados;
using DbNetLink.Data;

namespace ProjetoConfeitaria
{
    public partial class Login : Form
    {
        public Login()
        {
            InitializeComponent();
        }

        private void btnAcessar_Click(object sender, EventArgs e)
        {
            Conexao cn = new Conexao();
            DataTable dt = new DataTable();

            string sql = "select cidcep from cidades";

            string E = cn.executeScalar(sql).ToString();


            string user = txtUser.Text;
            string pass = txtPass.Text;

            if ((user == "a") && (pass == "a"))
            {
                Menu formMenu = new Menu();
                formMenu.Show();

                this.Visible = false;
            }
            else
            {
                MessageBox.Show("Usuário ou Senha Incorretos!", "Atenção!", MessageBoxButtons.OK,MessageBoxIcon.Error);
            }
        }

        private void btnCancelar_Click(object sender, EventArgs e)
        {
            DialogResult Resultado = MessageBox.Show("Gostaria de Sair?", "Aviso", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (Resultado == DialogResult.Yes)
            {
                Application.Exit();
            }
        }
    }
}